﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using eeenno.ReaderEngine.Utilities;

namespace eeenno.SpeeedReaderUI.Forms
{
    public partial class SettingsSocialForm : Form
    {
        public SettingsSocialForm()
        {
            InitializeComponent();
            LoadSettings();
        }

        public void LoadSettings()
        {         
            checkBox_use_tiny_url.Checked = Settings.shorten_url;
            textBox_twitter_username.Text = Settings.twitter_username;
            textBox_twitter_password.Text = Settings.twitter_password;
        }

        private void menuItem_save_Click(object sender, EventArgs e)
        {
            Settings.twitter_username = textBox_twitter_username.Text;
            Settings.twitter_password = textBox_twitter_password.Text;
            Settings.shorten_url = checkBox_use_tiny_url.Checked;
            Settings.WriteSettings();
            DialogResult = DialogResult.OK;
        }

        private void menuItem_cancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }       
    }
}